package com.hln.jingwushi.room.dao

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Query
import androidx.room.Update
import com.hln.jingwushi.room.entities.MonitoringEntity

@Dao
interface MonitoringDao  {

    @Query("Delete FROM Monitoring")
    suspend fun deleteAll()
    @Query("SELECT * FROM Monitoring")
    suspend fun getAll(): List<MonitoringEntity>?

    @Query("SELECT * FROM Monitoring WHERE name LIKE :name")
    suspend fun findByName(name: String): MonitoringEntity?

    @Query("SELECT * FROM Monitoring WHERE id IN (:ids)")
    suspend fun loadAllByIds(ids: IntArray): List<MonitoringEntity>?

    @Query("SELECT *FROM Monitoring WHERE id LIKE:id")
    suspend fun findById(id: Int): MonitoringEntity?

    @Update
    suspend fun updateUser( user: MonitoringEntity)
    @Delete
    suspend fun delete(user: MonitoringEntity)

}